package com.hc.model.code04.test3;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @version v1.0
 * @ClassName: Waiter
 * @Description: 具体的服务员类
 * @Author: HC
 */
public class Waiter {

    private List<Command> commands = new ArrayList<>();

    public void setCommands(Command command) {
        // 将具体订单封装起来
        commands.add(command);
    }

    public void orderUp() {
        for (Command command : commands) {
            // 将所有订单交给厨师进行完成
            command.execute();
        }
    }
}
